<template>
  <div>
    <div class="banner" @click = "showNow">
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <div class="banner-title">
          {{this.sightName}}
        </div>
        <div class="banner-number">
          <span class="iconfont">&#xe692;</span>
          {{this.bannerImg.length}}
        </div>
      </div>
    </div>
    <gallary :imgs = "bannerImg" v-show = "gallaryShow" @close = "handleGallaryClose"/>
  </div>
</template>

<script type="text/ecmascript-6">
import Gallary from 'common/gallary/Gallary'

export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      gallaryShow: false

    }
  },
  components: {
    Gallary
  },
  methods: {
    showNow () {
      this.gallaryShow = true
    },
    handleGallaryClose () {
      this.gallaryShow = false
    }

  }

}
</script>

<style scoped lang="stylus">
  .banner
    overflow hidden
    height 0
    padding-bottom 55%
    position relative
    .banner-img
      width 100%
    .banner-info
      display flex
      position absolute
      left 0
      right 0
      bottom 0
      line-height 0.6rem
      height 0.6rem
      color #fff
      padding 0 .2rem
      background-image linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
      .banner-title
        flex 1
      .banner-number
        padding 0 0.2rem
        line-height 0.4rem
        height 0.4rem
        border-radius 0.2rem
        background rgba(0,0,0,0.8)
        font-size 0.24rem
        .iconfont
          color #fff

</style>
